# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=dex2jar
pkgver=2.4
pkgrel=1
groups=('blackarch' 'blackarch-hardware' 'blackarch-reversing')
pkgdesc="A tool for converting Android's .dex format to Java's .class format."
arch=('any')
url='https://github.com/pxb1988/dex2jar'
license=('Apache')
depends=('java-environment')
source=('https://github.com/pxb1988/dex2jar/files/1867564/dex-tools-2.1-SNAPSHOT.zip')
sha512sums=('6e34bda6ba2bc94b40f23f565b4802168125f35b90a642b23119aa3f2e6c415365dc7b6d0b6a219253ea10a5c10142351471f6af9945c4e548e00f15a6767086')

package() {
  cd "dex-tools-$pkgver-SNAPSHOT"

  install -dm 755 "$pkgdir/usr/bin"
  install -dm 755 "$pkgdir/usr/share/$pkgname/lib"

  install -m 644 lib/*.jar "$pkgdir/usr/share/$pkgname/lib"
  install -m 755 *.sh "$pkgdir/usr/share/$pkgname"

  for bin in d2j-*.sh ; do
    ln -s "/usr/share/$pkgname/$bin" "$pkgdir/usr/bin/${bin%.*}"
  done
}

